<%--
  Created by IntelliJ IDEA.
  User: ASUS
  Date: 2020/9/23
  Time: 11:18
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="utf-8">
    <title>花海花店用户注册</title>

    <style type="text/css">
        <%--body{--%>
            <%--background-image: url(${pageContext.request.contextPath}/static/photo/home2-slide1.jpg);--%>
            <%--background-repeat: repeat-x;--%>
        <%--}--%>
    </style>

    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/layui/css/layui.css" media="all" />
    <!-- CSS -->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/supersized.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/login.css">
    <link href="${pageContext.request.contextPath}/static/css/bootstrap.min.css" rel="stylesheet">
    <script src="${pageContext.request.contextPath}/static/js/jquery-1.8.2.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/jquery.form.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/tooltips.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/uregister.js"></script>
</head>
<body background="${pageContext.request.contextPath}/static/photo/home2-slide1.jpg">
<div class="page-container">
    <div class="main_box">
        <div class="login_box">
            <div class="login_logo">
                <h3>花海花店</h3>
            </div>
            <div class="login_form">
                <form action="${pageContext.request.contextPath}/user/userRegister" id="tijiao" method="post">
                    <div class="form-group">
                        <label for="userLoginId" class="t">账号：</label>
                        <input id="userLoginId" placeholder="请输入账号" name="userLoginId" type="text" class="form-control x319 in"
                               autocomplete="off">
                    </div>
                    <div class="form-group">
                        <label for="userPwd" class="t">密码：</label>
                        <input id="userPwd" placeholder="请输入密码" name="userPwd" type="password"
                               class="form-control x319 in"
                               autocomplete="off">
                    </div>

                    <div class="form-group">
                        <label for="uname" class="t">用户名：</label>
                        <input id="uname" placeholder="请输入用户名" name="uname" type="text" lay-verify="required"
                               class="form-control x319 in"
                               autocomplete="off">
                    </div>

                    <div class="form-group">
                        <label for="uaddress" class="t">收货地址：</label>
                        <input id="uaddress" placeholder="请输入收货地址" name="uaddress" type="text"
                               class="form-control x319 in"
                               autocomplete="off">
                    </div>

                    <div class="form-group">
                        <label for="uphone" class="t">电话号码：</label>
                        <input id="uphone" placeholder="请输入电话号码" name="uphone" type="text" lay-verify="required|phone"
                               class="form-control x319 in  "
                               autocomplete="off">
                    </div>

                    <div class="layui-form-item input-item" id="imgCode">
                        <label for="code">验证码: </label>  <span id="spanYzm" ></span>
                        <input width="100px" type="text" placeholder="请输入验证码" autocomplete="off" id="code" name="code" class="layui-input" lay-verify="required" onblur="chkYzm()">
                        <input type="hidden">



                        <img id="theYzm" src="${pageContext.request.contextPath}/user/autoyzm" style="position: relative;top: 10px;" onclick="flushYzm()">

                    </div>

             <div class="form-group space">
                        <label class="t"></label>　　　
                        <button type="button"  id="submit_btn"
                                class="btn btn-primary btn-lg">&nbsp;注&nbsp;册&nbsp </button>
                        <input type="reset" value="&nbsp;重&nbsp;置&nbsp;" class="btn btn-default btn-lg">
                    </div>
                </form>
            </div>
        </div>
        <div class="bottom">Copyright &copy; 花海花店 </div>
    </div>
</div>

<!-- Javascript -->
<script src="${pageContext.request.contextPath}/static/js/supersized.3.2.7.min.js"></script>
<script src="${pageContext.request.contextPath}/static/js/supersized-init.js"></script>
<script src="${pageContext.request.contextPath}/static/js/scripts.js"></script>

<script type="text/javascript" src="${pageContext.request.contextPath}/static/layui/layui.js"></script>
<script>

    $(function () {
        $("#theYzm").click(flushYzm)
        $("#submit_btn").blur(chkYzm)
    })
    function flushYzm() {
        $("#theYzm").attr("src", "${pageContext.request.contextPath}/user/autoyzm?id="+new Date())
    }
    function chkYzm() {
        var inputYzm  =$("#code").val();
        $.post("${pageContext.request.contextPath}/user/chkyzm?yzmKey="+ inputYzm,function (r) {
            if(r != 0){
                // 刷新验证码
                $("#spanYzm").html("验证码错误")
                $("#submit_btn").attr('disabled',true);
            }else{
                $("#spanYzm").html("");
                $("#submit_btn").attr('disabled',false);
            }
        })
    }
</script>
</body>
</html>
